package com.heyqing.topic.LengthOfLastWord_0058;

/**
 * ClassName:LengthOfLastWord
 * Package:com.heyqing.topic.LengthOfLastWord_0058
 * Description:
 *
 * @Date:2024/9/10
 * @Author:Heyqing
 */
public class LengthOfLastWord {
    /**
     * 最后一个单词的长度
     *
     * @param s
     * @return
     */
    public int lengthOfLastWord(String s) {
        String[] strs = s.split(" ");
        return strs[strs.length - 1].length();
    }
}
